﻿using System.Net;
using System.Text;

namespace Kiva7.Utilities
{
    public class PostDataBuilder
    {
        private StringBuilder postData = new StringBuilder();

        public void Add(string name, string value)
        {
            if (postData.Length > 0)
            {
                postData.Append("&");
            }
            postData.Append(name);
            postData.Append("=");
            postData.Append(HttpUtility.UrlEncode(value));

            //postData.AppendFormat("{0}={1}", "email", HttpUtility.UrlEncode("your email id"));  
        }

        public int Length
        {
            get 
            {
                return postData.Length;
            }
        }

        public override string ToString()
        {
            return postData.ToString();
        }
    
    }
}
